"""Test configuration and fixtures."""

import os
from typing import Dict

import pytest
from fastapi.testclient import TestClient

from src.crcs.api.main import app


@pytest.fixture
def test_client():
    """Create a test client for the API."""
    return TestClient(app)


@pytest.fixture
def sample_merchant_data() -> Dict:
    """Sample merchant data for testing."""
    return {
        "transaction_amount": 10000,
        "transaction_count": 100,
        "service_rating": 4.5,
        "product_quality": 4.2,
        "platform_activity": 0.8,
        "compliance_score": 0.9
    }


@pytest.fixture
def sample_user_data() -> Dict:
    """Sample user data for testing."""
    return {
        "consumption_amount": 5000,
        "transaction_frequency": 50,
        "payment_reliability": 0.95,
        "return_rate": 0.05,
        "complaint_rate": 0.02,
        "social_score": 0.8
    }